package org.chw.core.utils;

import org.apache.commons.codec.digest.DigestUtils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
 * @ClassName: StringCodeUtils
 * @Description: 字符串工具
 * @Autor: Vincent.Chen
 * @Create: 2018/6/12 20:21
 * @Version: 1.0
 **/
public class StringCodeUtils {
  /**
   * @Author: Vincent.Chen
   * @Description: sha1加密字符串
   * @Date 2018/6/12 20:36
   * @Param [str]
   * @return java.lang.String
   **/
  public static String sha1(String str) {
    return DigestUtils.sha1Hex(str);
  }

  public static String sha(String str){
    String result = null;
    try {
      MessageDigest md = MessageDigest.getInstance("SHA-1");
      result = md.digest(str.getBytes()).toString();
    } catch (NoSuchAlgorithmException e) {
      e.printStackTrace();
    }
    return result;
  }

  public static String strOrder(List<String> list) {

    return null;
  }
}
